package person.learn.conf;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * Created by barton on 16-1-26.
 * 1. 此类从yaml或者properties文件中读取相应的配置信息并赋值给相对应的字段，使用时直接注入此类，
 * 然后用getter方法就可以直接获取配置文件中相应的配置项内容
 */
@Component
@ConfigurationProperties(prefix = "learn")
public class SettingsWithJavaClass {

    private String appName;

    private String appDescription;

    public String getAppName() {
        return appName;
    }

    public void setAppName(String appName) {
        this.appName = appName;
    }

    public String getAppDescription() {
        return appDescription;
    }

    public void setAppDescription(String appDescription) {
        this.appDescription = appDescription;
    }
}
